home *** CD-ROM | disk | FTP | other *** search
- Path: lrz-muenchen.de!news
- From: ua302aa@lrz-muenchen.de ()
- Newsgroups: comp.lang.c
- Subject: Re: Please help me
- Date: 26 Mar 1996 16:09:08 GMT
- Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
- Distribution: world
- Message-ID: <4j94r4$gqq@sparcserver.lrz-muenchen.de>
- References: <4j6oke$lfk@badger.wmin.ac.uk>
- NNTP-Posting-Host: sun2.lrz-muenchen.de
-
- darec@westminster.ac.uk (Nadarajah Thavaneethan) writes:
-
- >#include <std.h>
-
- There is no header with that name on _all_ the machines available to
- me.
-
- >void writelines( char[], int );
- > int index;
-
- Is there a good reason to make "index" a global variable.
-
- >void main(void)
-
- I will not comment on this.
-
- >{
- >int i;
- >char rest[80];
- > printf("Enter line ");
- > scanf("%s", rest);
- > printf("Enter size of new lines");
- > scanf("%d", i);
-
- This will not work. The reason why is explained in the FAQ for this newsgroup.
- To make it work, you could try to change it to
-
- scanf("%d", &(*(&i)));
-
- Or you could try to read something about "stdio" in a good textbook.
-
- > index =0;
- > writelines(rest, i);
- >}
-
- >void writelines( char r[], int len)
- >{
- >int i;
- > while (index < 80) {
- > for (i=0; i<len; i++)
- > {
- > putchar(r[index]);
- > putchar('\n');
- > }
- > index++;
- >}
- >}
-
- This will print the first char len times, in len different lines. Next
- it will print the second char len times, in len different lines. It
- will print all the characters that happen to be in the buffer declared
- in main() that are not overwritten by user input.
-
- A word of general advice: Translating the bible without either a
- grammer or a dictionary for ancient hebrew is difficult. Without
- the original text, it becomes next to impossible.
-
- Kurt
- --
- | Kurt Watzka Phone : +49-89-2180-6254
- | watzka@stat.uni-muenchen.de
- | ua302aa@sunmail.lrz-muenchen.de
-
-